<?php
$this->title = $model['title'];
?>
<div class="page-banner page-banner-news">
    <h1>快讯</h1>
</div>
<!--/page-banner-->
<ul class="box-main page-nav">
    <li><a href="<?=Yii::$app->homeUrl?>"><?=Yii::$app->name?></a></li>
    <li><a href="<?=Yii::$app->urlManager->createUrl(['post/index', 'cid'=>$model['cate']['id']])?>"><?=$model['cate']['name']?></a></li>
    <li><span>资讯内容</span></li>
</ul>
<!--/page-nav-->
<div class="box-main box-white clearfix pa-15">
    <div class="news-detail-main">
        <div class="news-detail-tags">
            <span><?=$model['cate']['name']?></span>
        </div>
        <div class="news-detail-title"><?=$model['title']?></div>
        <div class="news-detail-time">
            <i class="fa fa-clock-o"></i> <?=date('Y-m-d H:i', $model['created_at'])?>
        </div>
        <div class="news-detail-con">
            <?=$model['content']?>
        </div>
        <div class="news-detail-share">
            <a href="#" class="btn-share">分享</a>
        </div>
        <div class="news-detail-nav">
            <div class="prev">
                <a href="<?=$page['prev']['url']?>">
                    <h6>上一篇</h6>
                    <div class="article">
                        <?=$page['prev']['title']?>
                    </div>
                </a>
            </div>
            <div class="next">
                <a href="<?=$page['next']['url']?>">
                    <h6>下一篇</h6>
                    <div class="article">
                        <?=$page['next']['title']?>
                    </div>
                </a>
            </div>
        </div>
    </div>
    <!--/news-detail-main-->
    <div class="news-detail-sidebar">
        <div class="sidebar-news-list">
            <h3>最新文章</h3>
            <ul>
                <?php foreach ($newPosts as $post): ?>
                <li>
                    <a href="<?=Yii::$app->urlManager->createUrl(['post/view', 'id'=>$post['id']])?>">
                        <figure class="useThumb">
                            <img src="/uploads/<?=\app\core\widgets\webuploader\Picture::getPic($post['thumb'])['path']?>" onerror="this.src='/uploads/empty.jpg'" alt="">
                        </figure>
                        <div class="con">
                            <span><?=$post['title']?></span>
                        </div>
                    </a>
                </li>
                <?php endforeach; ?>
            </ul>
        </div>
        <!--/sidebar-news-list-->
    </div>
    <!--/news-detail-sidebar-->
</div>
<!--/box-main-->